/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package cl.zeke.pizzastore.negocio.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author taller
 */
@Embeddable
public class VentaPizzaPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID_VENTA")
    private long idVenta;
    @Basic(optional = false)
    @Column(name = "ID_PIZZA")
    private long idPizza;

    public VentaPizzaPK() {
    }

    public VentaPizzaPK(long idVenta, long idPizza) {
        this.idVenta = idVenta;
        this.idPizza = idPizza;
    }

    public long getIdVenta() {
        return idVenta;
    }

    public void setIdVenta(long idVenta) {
        this.idVenta = idVenta;
    }

    public long getIdPizza() {
        return idPizza;
    }

    public void setIdPizza(long idPizza) {
        this.idPizza = idPizza;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) idVenta;
        hash += (int) idPizza;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof VentaPizzaPK)) {
            return false;
        }
        VentaPizzaPK other = (VentaPizzaPK) object;
        if (this.idVenta != other.idVenta) {
            return false;
        }
        if (this.idPizza != other.idPizza) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cl.zeke.pizzastore.negocio.entities.VentaPizzaPK[ idVenta=" + idVenta + ", idPizza=" + idPizza + " ]";
    }
    
}
